﻿@using ZoomLa.Components
@model System.String
@{
    string css = "required";
    MvcHtmlString required = MvcHtmlString.Create("<span class=\"required_sp\">*</span>");
    string[] fields = SiteConfig.UserConfig.RegFieldsMustFill.Split(',');
    switch (Model)
    {
        case "select":
            css = "";
            required = MvcHtmlString.Create("");
            fields = SiteConfig.UserConfig.RegFieldsSelectFill.Split(',');
            break;
        case "must":
            break;
    }
}
@if (fields.Contains("ParentUser"))
{

<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">推荐人 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtParentUser" name="TxtParentUser" class="form-control @css input-sm" title="推荐人不能为空" onblur="CheckParentUser(this)" />
<div class="msg"></div>
<script>
function CheckParentUser(input) {
if (ZL_Regex.isEmpty(input.value)) { return; }
reghelp.check("puser", input.value, function () { reghelp.showok(input); }, function (model) { reghelp.showerr(model.retmsg, input); });
}
$("#TxtParentUser").val($("#ParentUser_Hid").val());
</script>
</div>
</div>
}
@if (fields.Contains("InvitCode"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">邀请码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtInvitCode" name="TxtInvitCode" title="邀请码不能为空" class="form-control @css input-sm" onblur="CheckInvitCode(this)" />
<div class="msg"></div>
<script>
function CheckInvitCode(input) {
	if (ZL_Regex.isEmpty(input.value)) { return; }
	reghelp.check("invite", input.value, function () { reghelp.showok(input); }, function (model) { reghelp.showerr(model.retmsg, input); });
}
</script>
</div>
</div>
}
@if (fields.Contains("UserSex"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">性别 @required</label></div>
<div class="weui-cell__bd">
<select name="DropSex" id="DropSex" class="form-control input-sm">
<option value="1" selected="selected">男</option>
<option value="0">女</option>
</select>
</div>
</div>
}
@if (fields.Contains("Birthday"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">出生日期 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtBirthday" name="TxtBirthday" onblur="CheckBirthDay(this)" title="出生日期不能为空" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' });" class="form-control @css input-sm" />
<div class="msg"></div>
<script>
function CheckBirthDay(input) {
	if (ZL_Regex.isEmpty(input.value)) { return; }
	reghelp.check("birth", input.value, function () { reghelp.showok(input); }, function (model) { reghelp.showerr(model.retmsg, input); });
}
</script>
</div>
</div>
}
@if (fields.Contains("Homepage"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">主页 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtHomepage" name="TxtHomepage" class="form-control @css input-sm" value="http://" />
</div>
</div>
}
@if (fields.Contains("QQ"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">QQ号码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtQQ" name="TxtQQ" class="form-control @css input-sm" title="QQ号码不能为空" />
</div>
</div>
}
@if (fields.Contains("OfficePhone"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">办公电话 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtOfficePhone" name="TxtOfficePhone" class="form-control @css input-sm" title="办公电话不能为空" />
</div>
</div>
}
@if (fields.Contains("HomePhone"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">家庭电话 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtHomePhone" name="TxtHomePhone" title="家庭电话不能为空" class="form-control @css input-sm" />
</div>
</div>
}
@if (fields.Contains("Fax"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">传真号码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtFax" name="TxtFax" class="form-control @css input-sm" title="传真号码不能为空" />
</div>
</div>
}
@if (fields.Contains("Mobile"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">手机号码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtMobile" name="TxtMobile" title="手机号码格式不正确" class="form-control mobile input-sm" />
</div>
</div>
}
@if (fields.Contains("Address"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">联系地址 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtAddress" name="TxtAddress" title="联系地址不能为空" class="form-control @css input-sm" />
</div>
</div>
}
@if (fields.Contains("ZipCode"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">邮政编码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtZipCode" name="TxtZipCode" maxlength="6" title="邮政编码格式不正确" class="form-control zipcode input-sm" />
</div>
</div>
}
@if (fields.Contains("Permissions"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">真实姓名 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtTrueName" name="TxtTrueName" class="form-control @css input-sm" title="真实姓名不能为空" />
</div>
</div>
}
@if (fields.Contains("IDCard"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">身份证号码 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtIDCard" name="TxtIDCard" class="form-control idcard @css input-sm" maxlength="20" title="身份证格式不正确" />
</div>
</div>
}
@if (fields.Contains("UserFaceR"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">头像地址 @required</label></div>
<div class="weui-cell__bd">
<input type="text" id="TxtUserFace" name="TxtUserFace" title="头像不址不能为空" class="form-control @css input-sm" />
</div>
</div>
}
@if (fields.Contains("Province"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">省市县 @required</label></div>
<div class="weui-cell__bd">
<select name="selprovince" id="selprovince" class="form-control input-sm pull-left" style="width:33.3333%;"></select>
<select name="selcity" id="selcity" class="form-control input-sm pull-left" style="width:33.3333%;"></select>
<select name="selcoutry" id="selcoutry" class="form-control input-sm pull-left" style="width:33.3333%;"></select>
</div>
</div>
}
@if (fields.Contains("Sign"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">签名档 @required</label></div>
<div class="weui-cell__bd">
<textarea id="TxtSign" name="TxtSign" title="签名档不能为空" class="form-control @css input-sm" rows="3"></textarea>
</div>
</div>
}
@if (fields.Contains("Privacy"))
{
<div class="weui-cell">
<div class="weui-cell__hd"><label class="weui-label">隐私设定 @required</label></div>
<div class="weui-cell__bd">
<select id="DropPrivacy" class="form-control input-sm">
<option value="0" selected="selected">公开信息</option>
<option value="1">只对好友公开</option>
<option value="2">完全保密</option>
</select>
</div>
</div>
}